﻿-- Поиск наименование столбцов в таблицах
CREATE PROCEDURE [dbo].[USPTOOLST_DBFindColumns]
	@column_name [sysname]
WITH EXECUTE AS CALLER
AS
DECLARE @column		sysname
SET @column = '%' + @column_name + '%'
SELECT a.name AS Column_Name, b.name AS Table_Name
FROM dbo.syscolumns a JOIN dbo.sysobjects b ON a.id = b.id
WHERE a.name LIKE @column
AND b.xtype = 'U'
ORDER BY table_name


